<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FIRST LEGO League na Slovensku - FLL na Slovensku</title>
<base href="http://www.fll.sk/" />
<link href="http://kempelen.ii.fmph.uniba.sk/letnaliga/styles.css" rel="stylesheet" type="text/css" />
</head>
    <body>
        <?php echo form_open('assignment_control/index'); ?>
                <label for='name'>Názov:</label>
                <input type='text' id='name' name='name' size='24'></input>
            <p>
                <textarea id="content" name="content" rows="10" style="width: 90%; border-width: 2pt; margin: auto;">
                    <?php if (isset($content)) { echo $content; }?>
                </textarea>
            </p>
                <table>
                <tr>
                    <td><label for='start'>Začiatok: (yyyy-mm-dd hh:mm:ss)</label></td>
                    <td><input id='start' name='start' type='text' size='19' value='<?php if(isset($start)){ echo $start; } else {echo "";}?>'/></td>
                </tr>
                <tr>
                    <td><label for='end'>Koniec: (yyyy-mm-dd hh:mm:ss)</label></td>
                    <td><input id='end' name='end' type='text' size='19' value='<?php if(isset($end)){ echo $end; } else {echo "";}?>'/></td>
                </tr>
                </table>
            <?php echo form_submit('zadanie', 'Pridaj zadanie'); ?>
        </form>
        <?php echo validation_errors(); ?><br/>
        <?php echo form_open_multipart('assignment_control/do_upload');?>
            <table>
                <tr>
                    <td><label for="file">Vyberte obrázok</label></td>
                    <td><input id="file" type="file" name="userfile" size="20" /></td>
                    <td><?php echo form_submit('obrazok', 'Upload!'); ?></td>
                </tr>
            </table>
        </form>
        <h2>Obrázky k dispozícii pre vytváranie zadania:</h2>
        <ul>
            <?php if(!empty($obrazky)) { 
                foreach($obrazky as $obr){ 
                    echo '<li>http://kempelen.ii.fmph.uniba.sk/letnaliga/attachments/'.$obr.' - <a href="'.base_url('assignment_control/delete_attachment/'.$obr).'">Vymazať</a></li>';             } 
            } ?>
        </ul>
        <p>
        <a href="<?php echo site_url('projekt/logged'); ?>"> Späť na zadania </a>
        </p>
    </body>
</html>